#!/usr/bin/env python3.6

children = ['xiaoming', 'xiaohong', 'xiaofang']

print('how many children? => ', len(children))

child = input('now, you can put in list to child.\n')
children.append(child)

print('your add child name is %s.' % children[len(children) - 1])

index = int(input('now, you can remove child, do you want remove(index): \n'))
child = children[index - 1]
children.pop(index)

print('all right, remove "%s" success!' % child)

# 列表生成式
create_list = list(range(1,100))
print('create a list by 1 to 100: ', create_list)

# 要生成的元素放在前面
# 生成一个1到10的列表的平方
list_1 = list(x*x for x in range(1,11))
print(list_1)

# 可以使用if来实现过滤器
# 生成一个1到10的列表的平方，但是只要偶数
list_2 = list(x*x for x in range(1,11) if x % 2 == 0)
print(list_2)
